<template>
<div class="Company-Component-Container">
    <Card class="Company-Name-Card" :title="lang.please_input_company_name">
        <NameComponent :rtl="lang.rtl" style="width: 100%" v-model="data.name"/>
    </Card>
    <Card class="Company-Name-Card" :title="lang.please_input_company_description">
        <NameComponent :rtl="lang.rtl" style="width: 100%" v-model="data.description"/>
    </Card>
    <Card class="Company-Name-Card" :title="lang.contacts">
        <ContactComponent style="width: 100%;" :rtl="lang.rtl" v-model="data.contacts" />
    </Card>
    <Card class="Company-Address-Card">
        <CountryComponent style="height: 400px;" v-model="data.addr" />
    </Card>
</div>
</template>


<script>
import { Company } from "../Entities/Company";
import NameComponent from "./Name";
import CountryComponent from "./Country"
import ContactComponent from "./Contact";

const DATA = "data";
const EVENT = "onChange";

export default {
  components: {
    NameComponent,
    CountryComponent,
    ContactComponent
  },
  model: {
    prop: DATA,
    event: EVENT
  },
  props: {
    data: {
      required: true,
      type: Object,
      validator: Company.isValid
    }
  },
  data() {
    return {};
  },
  computed: {
    lang() {
      return this.$store.state.lang;
    }
  }
};
</script>


<style lang="scss" scoped>
.Company-Component-Container {
  text-align: center;
  overflow: auto;
  position: unset;
  height: 540px;
}

.Company- {
  $width:400px;

  &Name-Card {
    margin: 10px;
    display: inline-block;
    width: $width;
    // background-color: red;
  }
  &Address-Card {
    margin: 10px;
    display: inline-block;
    width: $width;
  }
  &Contact-Card {
    margin: 10px;
    display: inline-block;
    width: $width;
  }
}
</style>
